﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import flash.utils.*;
    import Classes.util.*;

    public class CharacterDialog extends GenericDialog {

        protected var m_characterUrl:String = "assets/dialogs/quests/citysam_80.png";
        protected var m_characterLoader:Loader;
        protected var m_acceptButtonText:String;
        protected var m_dependencies:Array;
        protected var m_imagesLoaded:int = 0;
        protected var m_totalImages:int = 0;
        protected var m_formatParams:Object;

        public function CharacterDialog(_arg1:String, _arg2:String="", _arg3:int=0, _arg4:Function=null, _arg5:Function=null, _arg6:Boolean=true, _arg7:String="", _arg8:String="Okay", _arg9:Object=null){
            this.m_formatParams = new Object();
            this.m_characterUrl = ((_arg7)!="") ? _arg7 : this.m_characterUrl;
            this.m_acceptButtonText = _arg8;
            this.m_dependencies = [];
            this.m_formatParams = (_arg9) ? _arg9 : this.m_formatParams;
            super(_arg1, _arg2, _arg3, _arg4, _arg2, "", _arg6, 0, "", _arg5, "");
        }
        override protected function loadAssets():void{
            this.m_imagesLoaded = 0;
            this.m_totalImages = 2;
            Global.delayedAssets.get(DelayedAssetLoader.GENERIC_DIALOG_ASSETS, makeAssets);
            this.m_characterLoader = LoadingManager.load(Global.getAssetURL(this.m_characterUrl), this.onAssetsLoaded, LoadingManager.PRIORITY_HIGH);
        }
        override protected function createAssetDict():Dictionary{
            var _local1:Dictionary = new Dictionary();
            _local1["dialog_bg"] = (new m_comObject.dialog_bg() as DisplayObject);
            _local1["character"] = this.m_characterLoader.content;
            return (_local1);
        }
        override protected function onAssetsLoaded(_arg1:Event=null):void{
            this.m_imagesLoaded++;
            if (this.m_imagesLoaded < this.m_totalImages){
                return;
            };
            super.onAssetsLoaded(_arg1);
        }
        override protected function createDialogView(_arg1:Dictionary):GenericDialogView{
            var _local2:CharacterDialogView = new CharacterDialogView(_arg1, this.m_formatParams, m_message, m_dialogTitle, m_type, m_callback, m_icon, m_iconPos, this.m_acceptButtonText);
            return (_local2);
        }

    }
}//package Display.DialogUI 
